package com.example.anpapi.entity.po.usermodel.UserRelation;

import com.baomidou.mybatisplus.annotation.*;
import com.example.anpapi.entity.po.usermodel.UserRelation.RelationType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@TableName("user_relations")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class UserRelation implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 关系ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关注者ID
     */
    @TableField("follower_id")
    private Long followerId;

    /**
     * 被关注者ID
     */
    @TableField("following_id")
    private Long followingId;

    /**
     * 关系类型
     */
    @TableField("relation_type")
    private RelationType relationType;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

}

